/* 
 * File:   Platform.hpp
 * Author: Aaron
 *
 * Created on 19. Februar 2011, 15:14
 */

#ifndef PLATFORM_HPP
#define	PLATFORM_HPP


// -- Includes
#include "Types.hpp"
#include "Device.hpp"


// -- Forward declaration of class 'Platform' in header 'cl.hpp'.
//    'cl.hpp' is the C++ binding header of OpenCL and can be downloaded
//    from http://www.khronos.org.
namespace cl
{
    class Platform;
}


/**
 * Contains wrapper classes for using OpenCL on the local machine.
 */
namespace OpenCLWrapping
{
    /**
     * Represents an OpenCL platform
     */
    class Platform
    {
        public:
            // -- Public Constructors & Destructors
            Platform(const Platform& _orig);
            virtual ~Platform();

            // -- Public Methods
            Platform& operator=(const Platform& _other);
            /**
             * Retrieves the name of this platform.
             * @return A string which represents the name of this platform.
             */
            string getName() const;
            /**
             * Retrieves the name of this platform's vendor.
             * @return A string which represents the name of the vendor.
             */
            string getVendor() const;
            /**
             * Retrieves the default device of this platform.
             * @return An instance of \c Device which represents the default
             *      device of this platform.
             */
            Device getDefaultDevice() const;
            /**
             * Retrieves all available devices of this platform.
             * @return An instance of \c std::vector which contains
             *      instances of \c Device representing the devices.
             */
            vector<Device> getDevices() const;
            /**
             * Retrieves all available devices of specific types.
             * @param _types An bitfield of elements of the enumeration \c
             *      DeviceType which represents the types.
             */
            vector<Device> getDevices(DeviceType::DeviceType _types) const;

            // -- Public Static Methods
            /**
             * Retrieves the various platforms of the local machine.
             * @return An instance of \c std::vector which contains
             *      instances of this class representing the platforms.
             */
            static vector<Platform> getPlatforms();

        private:
            // -- Private Constructors
            Platform(const cl::Platform& _impl);

            // -- Private methods
            cl::Platform* getImpl();
            const cl::Platform* getImpl() const;

            // -- Members
            cl::Platform* m_Impl;
    };
}

#endif	/* PLATFORM_HPP */

